package com.huirui.server.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
@Schema(description = "购物车数据传输对象，用于表示购物车中的商品信息")
public class ShippingCartDto {

    @NotNull
    @Schema(description = "商品Id")
    private Long productId;

    @NotNull(message = "规格ID不能为空")
    @Schema(description = "规格ID，用于区分同一商品的不同规格（如颜色、尺寸等）", example = "2001", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long productSpecificationId;

    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量至少为1")
    @Schema(description = "商品数量", example = "2", minimum = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer quantity;
}